package com.kbbywyclient.ui.activity;

import android.webkit.WebSettings;

import com.kbbywyclient.R;
import com.kbbywyclient.app.API;
import com.kbbywyclient.di.AppComponent;
import com.kbbywyclient.ui.activity.base.BaseActivity;
import com.kbbywyclient.widget.CustomToolBar;
import com.kbbywyclient.widget.ProgressWebView;

import butterknife.BindView;

/**
 * Description: 协议
 * Created by FHW
 * on 2017/4/1
 */

public class AgreementActivity extends BaseActivity {

    @BindView(R.id.v_toolbar)
    CustomToolBar v_toolbar;
    @BindView(R.id.wv_contact)
    ProgressWebView wv_contact;

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_agreement;
    }

    @Override
    protected void onResume() {
        super.onResume();
        setScreenName("卡贝贝协议");
    }

    @Override
    protected void initView() {
        v_toolbar.setTitle("协议");
        v_toolbar.setLeftViewOnClickLinster(v -> finish());

        //设置webview
        wv_contact.getSettings().setDefaultTextEncodingName("UTF-8");
        //webview自适应屏幕
        WebSettings settings = wv_contact.getSettings();
        settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
        //                    settings.setBuiltInZoomControls(true); //显示放大缩小
        //                    settings.setSupportZoom(true); //可以缩放
        // webview自适应第二种
        settings.setUseWideViewPort(true);
        settings.setLoadWithOverviewMode(true);
        wv_contact.setSaveEnabled(true);
        settings.setJavaScriptEnabled(true); // 设置支持javascript脚本

        wv_contact.loadUrl(API.ABOUT_PROVI);

    }

    @Override
    public void initData() {

    }

    @Override
    public void initAppComponent(AppComponent appComponent) {

    }
}
